<template>
  <headerTopView
    :userN="userN"
    @outSide="outSide"
  ></headerTopView>
</template>

<script>
  import headerTopView from './headerTopView';
  import {localUitl} from '@/utils/localUitl'

  export default {

    components: {
      headerTopView
      // name
    },
    name: "headerTop",
    props: {
      // msg: String //  [name: typeof]
    },
    filters: {},
    computed: {},
    watch: {},
    data() {
      return {
        userN: {}
      }
    },
    created() {
      this.getUserN();
    },
    mounted() {

    },
    methods: {
      outSide(command) {
        localUitl.removeSessionItem("userData");
        this.$router.push('/');
      },
      getUserN() {
        let obj = {
          access_token: localUitl.getToken()
        }
        _https.get.getUserN(obj).then(res => {
          if (res.status == 200) {
            this.userN = res.data;
          }
        })
      }
    },
    destroyed() {

    }
  }
</script>

<style scoped lang="less">

</style>
